Softwares dependencies: Chloe & Multi package

This package is meant to be used together with Chloe (Boussard and Baudry 2017). Chloe is used to computed your landscape metrics.

How to

  • occupancy map of the landscape where you sampled your species, in ASCII format
  • the corresponding coordinates of your sampling points in CSV
  • The csv must be formatted like:

    ##       ID           X           Y
    ## 1 PF_B03 357690.3335 6829670.889
    ## 2 PF_B10 364265.2261 6831715.825
    ## 3 PF_B09 363789.7071 6832120.265
    ## 4 PF_B01 357800.5726 6825248.985
    ## 5 PF_B02 359015.1017  6827044.28
    ## 6 PF_B05 359886.9637 6837457.346

    ID is the name of your sampling points.

After that you can start running the analysis on Chloe following 10 step.

Multiscales analysis

Compute the metrics

  1. After launching Chloe you will see this page (Step 1). You want to click on “selected” under “landscape metrics” in “treatment”.
    Step 1

    Step 1

  2. On this new page, you want to load you occupancy map in ASCII format. For that you click on “browse”, and select the corresponding file.
    Step 2

    Step 2

  3. Now you want to add the scale to include in your analysis, select a distance and click on “add” continue the process until you have all the scales you want to analyse.
    Step 3

    Step 3

  4. The next step consist in adding the CSV where the coordinates of your sampling points are saved. For that you click on “browse”, and select the corresponding file.
    Step 4

    Step 4

  5. Now you can add the metrics wanted for the analysis. You can check what they compute by clicking the help button at the bottom right in the Chloe window.
    Step 5

    Step 5

  6. In this step you want to select a folder where the results will be saved. For that click on “browse” and select a folder.
    Step 6

    Step 6

  7. For this analysis you want to upload only the CSV. If you choose to also export ASCII you will a create a ASCII map for each pair of selected scales and metrics.
    Step 7

    Step 7

  8. This step is important for the rest of the analysis on R. You want to export all of your parameters in a file. For that click on the blue “export” button at the bottom of the page, and exported this “proprieties” file.
    Step 8

    Step 8

  9. You can now click on the blue “run” button at the bottom right of the Chloe window to start your analysis.
    Step 9

    Step 9

Compute the metrics to test their correlations

To test the correlations across metrics two solutions are offered:

  • If your sampling units are distributed randomly across all cover types you want to computed the metrics across all the landscape.

  • If your sampling units are distributed uniformly in only one type of cover (e.g. the sampling was made only in wood), then you want to generate a random number of points in this cover to computed metrics.

You probably choosed a lot of metrics and scales to test. The analysis will become a lot more heaver for Chloe to handle. So now we will start to use Chloe in R to computed metrics.
You will also need the package “Multi”.

Installation of “Multi” package

To install the package “Multi” follow this procedure below:

  1. To start the installation of the package, you will need the package “devtools”.
install.packages("devtools",repos = "http://cran.us.r-project.org")
library(devtools)
install_github("Pintademijote/multipack")
  1. During this step, in the console R will ask which packages you want to install, select the value corresponding to “all”. The installation of some packages unfortunately will fail. In this case just install the corresponding packahe manually. Example:
install.packages("FactoMineR",repos = "http://cran.us.r-project.org")
  1. Finaly you load the package like any other:
library(Multi)
Chloe call on R

To call Chloe on R, first use the code above below (in the case that you installed Chloe in the default folder):

source("C:/Users/Public/Inra/Chloe/R/chloe.R")
cl <- Chloe()

You also want to load the set of metrics and scales you choosed for the Analysis:

scales=read.Chloe.properties("C:/Users/pglem/Documents/Master/Stage M2/Données/batch_test3.properties","Distance") 
dist=as.numeric(scales)
metrics=read.Chloe.properties("C:/Users/pglem/Documents/Master/Stage M2/Données/batch_test3.properties","Metrics")
Case when your sampling points are randomly distributed across the landscape

The principe of this method is to computed map of the selected metrics at different scales. To do that you can follow the code bellow, where you will specified to Chloe in r:

  • the landscape cover map in ASCII
  • the metrics you want to computed
  • the folder where your generated ASCII will be stored
  • the prefix you want to put to the generated files
  • the treatment choosed in Chloe
  • if you want to export the map in ASCII
  • and the delta displacement of your windows to computed the metrics (for more info on this treatment you can consult the help in Chloe)
cl@input_ascii <-"C:/Users/pglem/Documents/Master/Stage M2/Données/ZAAR_dataSIG/cover2016/cover_bois_2016.asc"
cl@metrics <- metrics
cl@output_folder <- "C:/Users/pglem/Documents/Master/Stage M2/Données/Results_18_02/Sliding/"
cl@prefix <- "correlation_test_1"
cl@treatment <- "sliding"
cl@export_ascii <- TRUE
cl@delta_displacement<-10

Chloe is now ready to computed your metrics, to run the analysis you want now do a loop with the differente scales to analyse, as such:

pb <- txtProgressBar(min = 0, max = length(dist), style = 3)
repet=0
for (i in dist) {
  repet=repet+1
  setTxtProgressBar(pb, repet)
  cl@window_sizes <- c(i)
  run(cl)
}

Depending of the numbers of metrics and scales to analyse this process could be long. The files in the given folder will be like:

Case when your sampling points are uniformly distributed across the landscape

Correlations analysis (using Chloe on R)

Analysis of Chloe output on R

This section will explain the step on R to do the multiscales analysis of your Chloe output results.

  1. All needed function and package should be now installed. You want to load the package “Multi”. In the package the function read.Chloe.properties() let you read the scales and the metrics you used in your analysis in Chloe by reading the “proprieties” file you exported. The object “chloe” is results table output in Chloe of your analysis (note that the arguments added in read.csv are quite important in this script).
library(Multi)
metrics=read.Chloe.properties("C:/Users/pglem/Documents/Master/Stage M2/Données/batch_test3_grain.properties","Metrics")
scales=read.Chloe.properties("C:/Users/pglem/Documents/Master/Stage M2/Données/batch_test3_grain.properties","Distance")
chloe=read.csv("C:/Users/pglem/Documents/Master/Stage M2/Données/Results3/cover_2016_cr.csv", h=T, sep=";",check.names = F)

Boussard, Hugues, and Jacques Baudry. 2017. “Chloe4.0: A Software for Landscape Pattern Analysis.”